name: "blackbox-tests"
on:
  workflow_dispatch:
env:
  CGO_ENABLED: "0"
permissions:
  contents: read
jobs:
  blackbox-tests:
    timeout-minutes: 30
    runs-on: ubuntu-20.04
    steps:
      - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
      - name: "Set up Go"
        uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
        with:
          go-version-file: go.mod
      - name: "Install dependencies"
        run: |
          go mod tidy
      - name: "Setup user to test user id port exclusion"
        run: |
          sudo groupadd -g 4200 dns_test_user_group
          sudo useradd dns_test_user -u 4201 -g 4200 -m -s /bin/bash
      - name: "Run blackbox tests"
        run: |
          sudo "PATH=$PATH" $(which ginkgo) run ./test/blackbox_tests/...
